﻿using System;
using System.Collections.Generic;


namespace BizElements.BusinessLayer
{
    /// <summary>
    /// Manages settings in the data storage.
    /// </summary>
    public interface IAppSettingsManager
    {
        #region Methods.

        /// <summary>
        /// Retrieves all settings that match the filter criteria.
        /// </summary>
        /// <param name="filter">Partially populated <see cref="IAppSetting"/> object whose properties define a filter criteria.</param>
        /// <returns>A list of settings which match the filter criteria.</returns>
        IList<IAppSetting> Find(IAppSetting filter);

        /// <summary>
        /// Retrieves all settings that match the filter criteria.
        /// </summary>
        /// <param name="filter">Partially populated <see cref="IAppSetting"/> object whose properties define a filter criteria.</param>
        /// <param name="options">Specifies flags that control how filter is interpreted.</param>
        /// <returns>A list of settings which match the filter criteria.</returns>
        IList<IAppSetting> Find(IAppSetting filter, AppSettingsFilterOptions options);

        /// <summary>
        /// Deletes all settings that match the filter criteria.
        /// </summary>
        /// <param name="filter">Partially populated <see cref="IAppSetting"/> object whose properties define a filter criteria.</param>
        void Delete(IAppSetting filter);

        /// <summary>
        /// Saves the provided setting.
        /// </summary>
        /// <param name="setting">Settings information to save.</param>
        void Save(IAppSetting setting);

        /// <summary>
        /// Creates a new empty <see cref="IAppSetting"/> object compatibile with the current manager.
        /// </summary>
        /// <returns><see cref="IAppSetting"/> object.</returns>
        IAppSetting NewSetting();

        #endregion
    }
}
